FILE(GLOB_RECURSE protocol_SOURCES "*.cpp")

ADD_DEFINITIONS(-DBCP_STATIC=1)

ADD_LIBRARY(zmq_static STATIC IMPORTED)
SET_TARGET_PROPERTIES(zmq_static PROPERTIES IMPORTED_LOCATION ${ZeroMQ_ROOT_DIR}/lib/libzmq.a)

ADD_LIBRARY(protocol_static STATIC ${protocol_SOURCES})
SET_TARGET_PROPERTIES(protocol_static PROPERTIES OUTPUT_NAME mvs_protocol)
TARGET_LINK_LIBRARIES(protocol_static zmq_static ${Boost_LIBRARIES} ${bitcoin_LIBRARY})
INSTALL(TARGETS protocol_static DESTINATION lib)

IF(ENABLE_SHARED_LIBS)
    ADD_DEFINITIONS(-DBCP_DLL=1)
  ADD_LIBRARY(protocol_shared SHARED ${protocol_SOURCES})
  SET_TARGET_PROPERTIES(protocol_shared PROPERTIES OUTPUT_NAME mvs_protocol)
  TARGET_LINK_LIBRARIES(protocol_shared zmq ${Boost_LIBRARIES} ${bitcoin_LIBRARY})
  INSTALL(TARGETS protocol_shared DESTINATION lib)
ENDIF()
